package cc.verywell.pureblock.msg.nfs;

import java.util.Map;
import java.util.Set;

import cc.verywell.pureblock.func.node.KeyShell;

/**
* 
* Copyright © 2020 TanYaqiu. All rights reserved.
* @author TanYaqiu 
* @address flat 601
* @date 2020年2月5日 下午6:09:26
*/
public interface NfsAutoStoreRule {
	/**
	 * After progress will Run {@link NfsControler#newStored(Map)} , that will broadcast stored; <br>
	 * !!!NOTICE!!! editAbleFrom Will be edit later, so that's means, you must copy it into a new HashSet or Otherwise Set.
	 * @param fileHash
	 * @param payload
	 * @param editAbleFrom - where the fileHash come from address, we just know them has this file, and take file from one of them. and this can modifed
	 * @param isHandled - is handled by other program
	 * @return broadcast store to network
	 */
	public void fireNewFileStored(KeyShell fileHash, byte[] payload,Set<KeyShell> editAbleFrom, boolean isHandled);
	
	/**
	 * After progress will Run {@link NfsControler#newStored(Map)} , that will broadcast stored;
	 * @param fileHash
	 */
	public void newStored(KeyShell... fileHash);
}
